package com.tianyu.jty.shop.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 */
@Entity
@Table(name = "goods")
public class Goods implements java.io.Serializable {

	// Fields

	private static final long serialVersionUID = 1L;
	private Integer id;
	private GoodsType goodsType;//类型
	private String name;
	private String cover;//照片
	private String img;//编号
	private Double price;//成本价格
	private Double marketPrice;//市场价
	private String introduce;//介绍
	private String brief;//概要
	private String isSold;//是否有货
	private Integer sales;//销量
	private Double postage;//邮费
	private Integer pv;//报价次数
	private String containers;//集装箱量
	private String packSize;//包装规格
	private String valume;//体积
	private String grossWeight;//毛重
	private String unitPrice;//单价
	private String setPrice;//报价
	private String supplierQuotation;//供应商报价
	private String port;//港口
	private String deliveryTime;//交货时间
	private String remark;//备注
	private String photoName;//照片名称
	// Constructors

	/** default constructor */
	public Goods() {
		this.goodsType = new GoodsType();
	}

	/** minimal constructor */
	public Goods(GoodsType goodsType, String name, String cover, String img,
			Double price) {
		this.goodsType = goodsType;
		this.name = name;
		this.cover = cover;
		this.img = img;
		this.price = price;
	}

	/** full constructor */
	public Goods(GoodsType goodsType, String name, String cover, String img,
			Double price, Double marketPrice, String introduce, String brief,
			String isSold, Integer sales, Double postage, Integer pv) {
		this.goodsType = goodsType;
		this.name = name;
		this.cover = cover;
		this.img = img;
		this.price = price;
		this.marketPrice = marketPrice;
		this.introduce = introduce;
		this.brief = brief;
		this.isSold = isSold;
		this.sales = sales;
		this.postage = postage;
		this.pv = pv;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "TYPE_ID")
	public GoodsType getGoodsType() {
		return this.goodsType;
	}

	public void setGoodsType(GoodsType goodsType) {
		this.goodsType = goodsType;
	}

	@Column(name = "NAME")
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "COVER")
	public String getCover() {
		return this.cover;
	}

	public void setCover(String cover) {
		this.cover = cover;
	}

	@Column(name = "IMG")
	public String getImg() {
		return this.img;
	}

	public void setImg(String img) {
		this.img = img;
	}

	@Column(name = "PRICE", precision = 22, scale = 0)
	public Double getPrice() {
		return this.price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	@Column(name = "MARKET_PRICE", precision = 22, scale = 0)
	public Double getMarketPrice() {
		return this.marketPrice;
	}

	public void setMarketPrice(Double marketPrice) {
		this.marketPrice = marketPrice;
	}

	@Column(name = "INTRODUCE")
	public String getIntroduce() {
		return this.introduce;
	}

	public void setIntroduce(String introduce) {
		this.introduce = introduce;
	}

	@Column(name = "BRIEF")
	public String getBrief() {
		return this.brief;
	}

	public void setBrief(String brief) {
		this.brief = brief;
	}

	@Column(name = "IS_SOLD")
	public String getIsSold() {
		return this.isSold;
	}

	public void setIsSold(String isSold) {
		this.isSold = isSold;
	}

	@Column(name = "SALES")
	public Integer getSales() {
		return this.sales;
	}

	public void setSales(Integer sales) {
		this.sales = sales;
	}

	@Column(name = "POSTAGE", precision = 22, scale = 0)
	public Double getPostage() {
		return this.postage;
	}

	public void setPostage(Double postage) {
		this.postage = postage;
	}

	@Column(name = "PV")
	public Integer getPv() {
		return this.pv;
	}

	public void setPv(Integer pv) {
		this.pv = pv;
	}

	@Column(name = "PACKSIZE")
	public String getPackSize() {
		return packSize;
	}

	public void setPackSize(String packSize) {
		this.packSize = packSize;
	}

	@Column(name = "VALUME")
	public String getValume() {
		return valume;
	}

	public void setValume(String valume) {
		this.valume = valume;
	}

	@Column(name = "GROSS_WEIGHT")
	public String getGrossWeight() {
		return grossWeight;
	}

	public void setGrossWeight(String grossWeight) {
		this.grossWeight = grossWeight;
	}

	@Column(name = "UNIT_PRICE")
	public String getUnitPrice() {
		return unitPrice;
	}

	public void setUnitPrice(String unitPrice) {
		this.unitPrice = unitPrice;
	}

	@Column(name = "SET_PRICE")
	public String getSetPrice() {
		return setPrice;
	}

	public void setSetPrice(String setPrice) {
		this.setPrice = setPrice;
	}

	@Column(name = "PORT")
	public String getPort() {
		return port;
	}

	public void setPort(String port) {
		this.port = port;
	}

	@Column(name = "DELIVERY_TIME")
	public String getDeliveryTime() {
		return deliveryTime;
	}

	public void setDeliveryTime(String deliveryTime) {
		this.deliveryTime = deliveryTime;
	}

	@Column(name = "REMARK")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
	@Column(name = "PHOTO_NAME")
	public String getPhotoName() {
		return photoName;
	}

	public void setPhotoName(String photoName) {
		this.photoName = photoName;
	}
	@Column(name = "CONTAINERS")
	public String getContainers() {
		return containers;
	}

	public void setContainers(String containers) {
		this.containers = containers;
	}

	@Column(name = "SUPPLIER_QUOTATION")
	public String getSupplierQuotation() {
		return supplierQuotation;
	}

	public void setSupplierQuotation(String supplierQuotation) {
		this.supplierQuotation = supplierQuotation;
	}
	
}